\(\int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx\) [581]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 58 \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx=\frac {2 b \sqrt {d \sec (e+f x)}}{f}+\frac {2 a \sqrt {\cos (e+f x)} \operatorname {EllipticF}\left (\frac {1}{2} (e+f x),2\right ) \sqrt {d \sec (e+f x)}}{f} \]

[Out]

2*b*(d*sec(f*x+e))^(1/2)/f+2*a*(cos(1/2*f*x+1/2*e)^2)^(1/2)/cos(1/2*f*x+1/2*e)*EllipticF(sin(1/2*f*x+1/2*e),2^
(1/2))*cos(f*x+e)^(1/2)*(d*sec(f*x+e))^(1/2)/f

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3567, 3856, 2720} \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx=\frac {2 a \sqrt {\cos (e+f x)} \operatorname {EllipticF}\left (\frac {1}{2} (e+f x),2\right ) \sqrt {d \sec (e+f x)}}{f}+\frac {2 b \sqrt {d \sec (e+f x)}}{f} \]

[In]

Int[Sqrt[d*Sec[e + f*x]]*(a + b*Tan[e + f*x]),x]

[Out]

(2*b*Sqrt[d*Sec[e + f*x]])/f + (2*a*Sqrt[Cos[e + f*x]]*EllipticF[(e + f*x)/2, 2]*Sqrt[d*Sec[e + f*x]])/f

Rule 2720

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ
[{c, d}, x]

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3856

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rubi steps \begin{align*} \text {integral}& = \frac {2 b \sqrt {d \sec (e+f x)}}{f}+a \int \sqrt {d \sec (e+f x)} \, dx \\ & = \frac {2 b \sqrt {d \sec (e+f x)}}{f}+\left (a \sqrt {\cos (e+f x)} \sqrt {d \sec (e+f x)}\right ) \int \frac {1}{\sqrt {\cos (e+f x)}} \, dx \\ & = \frac {2 b \sqrt {d \sec (e+f x)}}{f}+\frac {2 a \sqrt {\cos (e+f x)} \operatorname {EllipticF}\left (\frac {1}{2} (e+f x),2\right ) \sqrt {d \sec (e+f x)}}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.81 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.72 \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx=\frac {2 \left (b+a \sqrt {\cos (e+f x)} \operatorname {EllipticF}\left (\frac {1}{2} (e+f x),2\right )\right ) \sqrt {d \sec (e+f x)}}{f} \]

[In]

Integrate[Sqrt[d*Sec[e + f*x]]*(a + b*Tan[e + f*x]),x]

[Out]

(2*(b + a*Sqrt[Cos[e + f*x]]*EllipticF[(e + f*x)/2, 2])*Sqrt[d*Sec[e + f*x]])/f

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 11.11 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.64

method result size
parts \(-\frac {2 i a \left (\cos \left (f x +e \right )+1\right ) F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \sqrt {d \sec \left (f x +e \right )}\, \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}{f}+\frac {2 b \sqrt {d \sec \left (f x +e \right )}}{f}\) \(95\)
default \(-\frac {2 \left (i \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) a \cos \left (f x +e \right )+i \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) a -b \right ) \sqrt {d \sec \left (f x +e \right )}}{f}\) \(138\)

[In]

int((d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

-2*I*a/f*(cos(f*x+e)+1)*EllipticF(I*(csc(f*x+e)-cot(f*x+e)),I)*(d*sec(f*x+e))^(1/2)*(1/(cos(f*x+e)+1))^(1/2)*(
cos(f*x+e)/(cos(f*x+e)+1))^(1/2)+2*b*(d*sec(f*x+e))^(1/2)/f

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.08 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.28 \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx=\frac {-i \, \sqrt {2} a \sqrt {d} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right ) + i \, \sqrt {2} a \sqrt {d} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right ) + 2 \, b \sqrt {\frac {d}{\cos \left (f x + e\right )}}}{f} \]

[In]

integrate((d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e)),x, algorithm="fricas")

[Out]

(-I*sqrt(2)*a*sqrt(d)*weierstrassPInverse(-4, 0, cos(f*x + e) + I*sin(f*x + e)) + I*sqrt(2)*a*sqrt(d)*weierstr
assPInverse(-4, 0, cos(f*x + e) - I*sin(f*x + e)) + 2*b*sqrt(d/cos(f*x + e)))/f

Sympy [F]

\[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx=\int \sqrt {d \sec {\left (e + f x \right )}} \left (a + b \tan {\left (e + f x \right )}\right )\, dx \]

[In]

integrate((d*sec(f*x+e))**(1/2)*(a+b*tan(f*x+e)),x)

[Out]

Integral(sqrt(d*sec(e + f*x))*(a + b*tan(e + f*x)), x)

Maxima [F]

\[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx=\int { \sqrt {d \sec \left (f x + e\right )} {\left (b \tan \left (f x + e\right ) + a\right )} \,d x } \]

[In]

integrate((d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e)),x, algorithm="maxima")

[Out]

integrate(sqrt(d*sec(f*x + e))*(b*tan(f*x + e) + a), x)

Giac [F]

\[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx=\int { \sqrt {d \sec \left (f x + e\right )} {\left (b \tan \left (f x + e\right ) + a\right )} \,d x } \]

[In]

integrate((d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate(sqrt(d*sec(f*x + e))*(b*tan(f*x + e) + a), x)

Mupad [B] (verification not implemented)

Time = 0.43 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.67 \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x)) \, dx=\frac {2\,\left (b+a\,\sqrt {\cos \left (e+f\,x\right )}\,\mathrm {F}\left (\frac {e}{2}+\frac {f\,x}{2}\middle |2\right )\right )\,\sqrt {\frac {d}{\cos \left (e+f\,x\right )}}}{f} \]

[In]

int((d/cos(e + f*x))^(1/2)*(a + b*tan(e + f*x)),x)

[Out]

(2*(b + a*cos(e + f*x)^(1/2)*ellipticF(e/2 + (f*x)/2, 2))*(d/cos(e + f*x))^(1/2))/f